package com.bytedance.frameworks.base.mvp;

import android.content.Context;

import java.util.LinkedList;
import java.util.List;

public abstract class AbsInteractor<V extends View> extends Interactor<V> {
    public V mView;
    private List<V> viewList;

    public AbsInteractor(Context context) {
        super(context);
        this.viewList = new LinkedList();
    }

    public void releaseView() {
        this.viewList.remove(this.mView);
        this.mView = !this.viewList.isEmpty() ? this.viewList.get(0) : null;
    }

    public void setView(V arg3) {
        this.mView = arg3;
        this.viewList.add(0, arg3);
    }

    public final boolean hasView() {
        return this.mView != null;
    }

    public final V getView() {
        return this.mView;
    }
}

